home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / Sources / FWPat.cpp < prev    next >
Encoding:
Text File  |  1995-11-08  |  4.5 KB  |  147 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWPat.cpp
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    © 1993, 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #include "FWOS.hpp"
  11.  
  12. #if defined(FW_PROFILER_CALLS) && defined(__MWERKS__)
  13. #pragma profile on
  14. #endif
  15.  
  16. #ifndef FWPAT_H
  17. #include "FWPat.h"
  18. #endif
  19.  
  20. #ifndef FWBWPAT_H
  21. #include "FWBWPat.h"
  22. #endif
  23.  
  24. #ifndef FWCPAT_H
  25. #include "FWCPat.h"
  26. #endif
  27.  
  28. #ifndef FWGRGLOB_H
  29. #include "FWGrGlob.h"
  30. #endif
  31.  
  32. //========================================================================================
  33. // RunTime Info
  34. //========================================================================================
  35.  
  36. #if FW_LIB_EXPORT_PRAGMAS
  37. #pragma lib_export on
  38. #endif
  39.  
  40. #ifdef FW_BUILD_MAC
  41. #pragma segment fwgraphx
  42. #endif
  43.  
  44. FW_DEFINE_CLASS_M1(FW_PPattern, FW_CGraphicCountedPtr)
  45. FW_DEFINE_CLASS_M1(FW_CPatternRep, FW_CGraphicCountedPtrRep)
  46.  
  47. //========================================================================================
  48. //    class FW_PPattern
  49. //========================================================================================
  50.  
  51. //----------------------------------------------------------------------------------------
  52. //    FW_PPattern::FW_PPattern
  53. //----------------------------------------------------------------------------------------
  54.  
  55. FW_PPattern::FW_PPattern() :
  56.     FW_CGraphicCountedPtr()
  57. {
  58. }
  59.  
  60. //----------------------------------------------------------------------------------------
  61. //    FW_PPattern::FW_PPattern
  62. //----------------------------------------------------------------------------------------
  63.  
  64. FW_PPattern::FW_PPattern(const FW_BitPattern& bits) :
  65.     FW_CGraphicCountedPtr()
  66. {
  67.     SetRep(new FW_CBWPatternRep(bits));
  68. }
  69.  
  70. //----------------------------------------------------------------------------------------
  71. //    FW_PPattern::FW_PPattern
  72. //----------------------------------------------------------------------------------------
  73.  
  74. FW_PPattern::FW_PPattern(const FW_PixelPattern& pixels, short nbColors, const FW_CColor* colorTable) :
  75.     FW_CGraphicCountedPtr()
  76. {
  77.     SetRep(new FW_CColorPatternRep(pixels, nbColors, colorTable));
  78. }
  79.  
  80. //----------------------------------------------------------------------------------------
  81. //    FW_PPattern::FW_PPattern
  82. //----------------------------------------------------------------------------------------
  83.  
  84. FW_PPattern::FW_PPattern(const FW_PPattern& other) :
  85.     FW_CGraphicCountedPtr(other)
  86. {
  87. }
  88.  
  89. //----------------------------------------------------------------------------------------
  90. //    FW_PPattern::FW_PPattern
  91. //----------------------------------------------------------------------------------------
  92.  
  93. FW_PPattern::FW_PPattern(FW_PlatformColorPattern platformColorPattern) :
  94.     FW_CGraphicCountedPtr()
  95. {
  96.     SetRep(new FW_CColorPatternRep(platformColorPattern));
  97. }
  98.  
  99. //----------------------------------------------------------------------------------------
  100. //    FW_PPattern::FW_PPattern
  101. //----------------------------------------------------------------------------------------
  102.  
  103. FW_PPattern::~FW_PPattern()
  104. {
  105. }
  106.  
  107. //----------------------------------------------------------------------------------------
  108. //    FW_PPattern::operator=
  109. //----------------------------------------------------------------------------------------
  110.  
  111. FW_PPattern& FW_PPattern::operator=(const FW_PPattern& other)
  112. {
  113.     // We don't need to test this == &other because SetRep will do it
  114.     SetRep(other.GetRep());
  115.     return *this;
  116. }
  117.  
  118. //----------------------------------------------------------------------------------------
  119. //    FW_PPattern::operator=
  120. //----------------------------------------------------------------------------------------
  121.  
  122. FW_PPattern& FW_PPattern::operator=(const FW_BitPattern& bits)
  123. {
  124.     SetRep(new FW_CBWPatternRep(bits));
  125.     return *this;
  126. }
  127.  
  128. //========================================================================================
  129. //    CLASS FW_CPatternRep
  130. //========================================================================================
  131.  
  132. //----------------------------------------------------------------------------------------
  133. //    FW_CPatternRep::FW_CPatternRep
  134. //----------------------------------------------------------------------------------------
  135.  
  136. FW_CPatternRep::FW_CPatternRep()
  137. {
  138. }
  139.  
  140. //----------------------------------------------------------------------------------------
  141. //    FW_CPatternRep::~FW_CPatternRep
  142. //----------------------------------------------------------------------------------------
  143.  
  144. FW_CPatternRep::~FW_CPatternRep()
  145. {
  146. }
  147.